import service from "@/utils/fetch";
const post = {
  //获取轮播图列表
  banner_list(params) {
    return service({
      method: "get",
      params,
      url: "/api/banner/",
    });
  },

  //新增轮播图
  banner_add(params) {
    return service({
      method: "post",
      data: params,
      url: "/api/banner/",
    });
  },

  //编辑轮播图
  banner_edit(params) {
    return service({
      method: "put",
      data: params,
      url: "/api/banner/",
    });
  },

  //删除轮播图
  banner_delete(params) {
    return service({
      method: "delete",
      data: params,
      url: "/api/banner/",
    });
  },

  // 根据id查询
  banner_detail(id) {
    return service({
      method: "get",
      url: `/api/banner/${id}`,
    });
  },
  
  //发布轮播图
  banner_publish(id) {
    return service({
      method: "post",
      data: {},
      url: `/api/banner/publish/${id}`,
    });
  },
};

export default post;
